package com.qianli.cashmama.trade.client.trade.request;

import com.fqgj.common.api.ParamsObject;
import com.fqgj.exception.common.ApplicationException;
import org.apache.commons.lang.StringUtils;

import java.util.Date;

/**
 * @program: market-loan-trade
 * @description
 * @author: frank
 * @create: 2020-12-29 15:02
 **/
public class ServiceFeePaymentCallBackRequest extends ParamsObject {

    /**
     * 三方支付成功时间
     */
    private Date tripleSuccessDate;
    /**
     * 支付流水号
     */
    private String acceptNo;
    /**
     * 会员费业务号
     */
    private String serviceNo;
    /**
     * 支付金额
     */
    private String paidAmount;

    @Override
    public void validate() {
        if(StringUtils.isEmpty(serviceNo)){
            throw new ApplicationException("serviceNo can not be empty");
        }
        if(tripleSuccessDate == null){
            throw new ApplicationException("tripleSuccessDate can not be empty");
        }
        if(StringUtils.isEmpty(acceptNo)){
            throw new ApplicationException("acceptNo can not be empty");
        }
        if(StringUtils.isEmpty(paidAmount)){
            throw new ApplicationException("paidAmount can not be empty");
        }
    }

    public Date getTripleSuccessDate() {
        return tripleSuccessDate;
    }

    public ServiceFeePaymentCallBackRequest setTripleSuccessDate(Date tripleSuccessDate) {
        this.tripleSuccessDate = tripleSuccessDate;
        return this;
    }

    public String getAcceptNo() {
        return acceptNo;
    }

    public ServiceFeePaymentCallBackRequest setAcceptNo(String acceptNo) {
        this.acceptNo = acceptNo;
        return this;
    }

    public String getServiceNo() {
        return serviceNo;
    }

    public ServiceFeePaymentCallBackRequest setServiceNo(String serviceNo) {
        this.serviceNo = serviceNo;
        return this;
    }

    public String getPaidAmount() {
        return paidAmount;
    }

    public ServiceFeePaymentCallBackRequest setPaidAmount(String paidAmount) {
        this.paidAmount = paidAmount;
        return this;
    }
}
